<!DOCTYPE html>
<html lang="zh-Hans">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 3.8.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"yoursite.com","root":"/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="将a表的某些列插入b表的某些列1insert into a(ac1,ac2) select bc1,bc2 from b where ...; 重命名表1ALTER TABLE table_name RENAME TO new_table_name； 重命名字段1ALTER TABLE table_name RENAME COLUMN column_name TO new_column_name;">
<meta name="keywords" content="oracle">
<meta property="og:type" content="article">
<meta property="og:title" content="oracle系列之常用操作命令">
<meta property="og:url" content="http://yoursite.com/2019/04/07/oracle系列之常用操作命令/index.html">
<meta property="og:site_name" content="Feng&#39;s Blog">
<meta property="og:description" content="将a表的某些列插入b表的某些列1insert into a(ac1,ac2) select bc1,bc2 from b where ...; 重命名表1ALTER TABLE table_name RENAME TO new_table_name； 重命名字段1ALTER TABLE table_name RENAME COLUMN column_name TO new_column_name;">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2020-03-29T07:22:29.020Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="oracle系列之常用操作命令">
<meta name="twitter:description" content="将a表的某些列插入b表的某些列1insert into a(ac1,ac2) select bc1,bc2 from b where ...; 重命名表1ALTER TABLE table_name RENAME TO new_table_name； 重命名字段1ALTER TABLE table_name RENAME COLUMN column_name TO new_column_name;">

<link rel="canonical" href="http://yoursite.com/2019/04/07/oracle系列之常用操作命令/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-Hans'
  };
</script>

  <title>oracle系列之常用操作命令 | Feng's Blog</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="Toggle navigation bar">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">Feng's Blog</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>Home</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>About</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>Tags</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>Categories</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>Archives</a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-Hans">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2019/04/07/oracle系列之常用操作命令/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Fengorz">
      <meta itemprop="description" content="A Quiet Departure.">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Feng's Blog">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          oracle系列之常用操作命令
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">Posted on</span>

              <time title="Created: 2019-04-07 10:34:12" itemprop="dateCreated datePublished" datetime="2019-04-07T10:34:12+08:00">2019-04-07</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">Edited on</span>
                <time title="Modified: 2020-03-29 15:22:29" itemprop="dateModified" datetime="2020-03-29T15:22:29+08:00">2020-03-29</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">In</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/oracle/" itemprop="url" rel="index"><span itemprop="name">oracle</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h2 id="将a表的某些列插入b表的某些列"><a href="#将a表的某些列插入b表的某些列" class="headerlink" title="将a表的某些列插入b表的某些列"></a>将a表的某些列插入b表的某些列</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">insert into a(ac1,ac2) select bc1,bc2 from b where ...;</span><br></pre></td></tr></table></figure>
<h2 id="重命名表"><a href="#重命名表" class="headerlink" title="重命名表"></a>重命名表</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ALTER TABLE table_name RENAME TO new_table_name；</span><br></pre></td></tr></table></figure>
<h2 id="重命名字段"><a href="#重命名字段" class="headerlink" title="重命名字段"></a>重命名字段</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ALTER TABLE table_name RENAME COLUMN column_name TO new_column_name;</span><br></pre></td></tr></table></figure>
<h2 id="修改字段类型"><a href="#修改字段类型" class="headerlink" title="修改字段类型"></a>修改字段类型</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ALTER TABLE tableName modify(columnName 类型);</span><br></pre></td></tr></table></figure>
<h2 id="增加多个字段"><a href="#增加多个字段" class="headerlink" title="增加多个字段"></a>增加多个字段</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">alter table test1 add (name varchar2(30) default ‘无名氏’ not null,</span><br><span class="line">age integer default 22 not null,</span><br><span class="line">has_money number(9,2));</span><br></pre></td></tr></table></figure>
<h2 id="主键操作"><a href="#主键操作" class="headerlink" title="主键操作"></a>主键操作</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">--设置主键</span><br><span class="line">alter table jack add constraint pk_id primary key(object_id);</span><br></pre></td></tr></table></figure>
<h2 id="删除表"><a href="#删除表" class="headerlink" title="删除表"></a>删除表</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">drop table tn;</span><br></pre></td></tr></table></figure>
<h2 id="查询表所属表空间"><a href="#查询表所属表空间" class="headerlink" title="查询表所属表空间"></a>查询表所属表空间</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">select tablespace_name, table_name</span><br><span class="line">  from user_tables</span><br><span class="line"> where table_name = &apos;EOMS_OUTER_PROJECT&apos;;</span><br></pre></td></tr></table></figure>
<h2 id="查询索引所在表空间"><a href="#查询索引所在表空间" class="headerlink" title="查询索引所在表空间"></a>查询索引所在表空间</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select index_name,tablespace_name from dba_indexes where index_name=&apos;INDEX_PS&apos;;</span><br></pre></td></tr></table></figure>
<h2 id="查询表的建表DDL"><a href="#查询表的建表DDL" class="headerlink" title="查询表的建表DDL"></a>查询表的建表DDL</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select dbms_metadata.get_ddl(&apos;TABLE&apos;,&apos;TABLE_NAME&apos;,&apos;DB_USER&apos;) from dual;</span><br></pre></td></tr></table></figure>
<h2 id="查看所有表空间大小以及使用情况"><a href="#查看所有表空间大小以及使用情况" class="headerlink" title="查看所有表空间大小以及使用情况"></a>查看所有表空间大小以及使用情况</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line">SELECT Upper(F.TABLESPACE_NAME) &quot;表空间名&quot;,</span><br><span class="line">       D.TOT_GROOTTE_MB &quot;表空间大小(M)&quot;,</span><br><span class="line">       D.TOT_GROOTTE_MB - F.TOTAL_BYTES &quot;已使用空间(M)&quot;,</span><br><span class="line">       To_char(Round((D.TOT_GROOTTE_MB - F.TOTAL_BYTES) / D.TOT_GROOTTE_MB * 100,</span><br><span class="line">                     2),</span><br><span class="line">               &apos;990.99&apos;) || &apos;%&apos; &quot;使用比&quot;,</span><br><span class="line">       F.TOTAL_BYTES &quot;空闲空间(M)&quot;,</span><br><span class="line">       F.MAX_BYTES &quot;最大块(M)&quot;</span><br><span class="line">  FROM (SELECT TABLESPACE_NAME,</span><br><span class="line">               Round(Sum(BYTES) / (1024 * 1024), 2) TOTAL_BYTES,</span><br><span class="line">               Round(Max(BYTES) / (1024 * 1024), 2) MAX_BYTES</span><br><span class="line">          FROM SYS.DBA_FREE_SPACE</span><br><span class="line">         GROUP BY TABLESPACE_NAME) F,</span><br><span class="line">       (SELECT DD.TABLESPACE_NAME,</span><br><span class="line">               Round(Sum(DD.BYTES) / (1024 * 1024), 2) TOT_GROOTTE_MB</span><br><span class="line">          FROM SYS.DBA_DATA_FILES DD</span><br><span class="line">         GROUP BY DD.TABLESPACE_NAME) D</span><br><span class="line"> WHERE D.TABLESPACE_NAME = F.TABLESPACE_NAME</span><br><span class="line"> ORDER BY &quot;使用比&quot; desc;</span><br></pre></td></tr></table></figure>
<h2 id="指定表空间查询所有表名"><a href="#指定表空间查询所有表名" class="headerlink" title="指定表空间查询所有表名"></a>指定表空间查询所有表名</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">Select Table_Name, Tablespace_Name</span><br><span class="line">From Dba_Tables</span><br><span class="line">Where Tablespace_Name = &apos;USERS&apos;;</span><br></pre></td></tr></table></figure>
<h2 id="通过指定表空间查询所属表的占用空间"><a href="#通过指定表空间查询所属表的占用空间" class="headerlink" title="通过指定表空间查询所属表的占用空间"></a>通过指定表空间查询所属表的占用空间</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">select segment_name, bytes/1024||&apos;KB&apos; &quot;占用空间&quot;</span><br><span class="line">from user_segments </span><br><span class="line">where segment_type=&apos;TABLE&apos; and tablespace_name=&apos;USERS&apos; order by segment_name asc;</span><br></pre></td></tr></table></figure>
<h2 id="删除列"><a href="#删除列" class="headerlink" title="删除列"></a>删除列</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ALTER TABLE table_name DROP COLUMN column_name;</span><br></pre></td></tr></table></figure>
<h2 id="查询所有表及其所使用的表空间"><a href="#查询所有表及其所使用的表空间" class="headerlink" title="查询所有表及其所使用的表空间"></a>查询所有表及其所使用的表空间</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select table_name 表名 ,tablespace_name 所使用表空间 from user_tables t where t.TABLE_NAME=&apos;T_PRE_AI_ACTIVITY&apos;;</span><br></pre></td></tr></table></figure>
<h2 id="查询所有表空间大小"><a href="#查询所有表空间大小" class="headerlink" title="查询所有表空间大小"></a>查询所有表空间大小</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">SELECT t.tablespace_name, round(SUM(bytes / (1024 * 1024)), 0) ts_size</span><br><span class="line">  FROM dba_tablespaces t, dba_data_files d</span><br><span class="line"> WHERE t.tablespace_name = d.tablespace_name</span><br><span class="line"> GROUP BY t.tablespace_name;</span><br></pre></td></tr></table></figure>
<h2 id="查询版本"><a href="#查询版本" class="headerlink" title="查询版本"></a>查询版本</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select * from v$version;</span><br></pre></td></tr></table></figure>
<h2 id="查看长时间未commit会话，10秒未commit"><a href="#查看长时间未commit会话，10秒未commit" class="headerlink" title="查看长时间未commit会话，10秒未commit"></a>查看长时间未commit会话，10秒未commit</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line">SELECT A.SID,</span><br><span class="line">       A.SERIAL#,</span><br><span class="line">       A.USERNAME,</span><br><span class="line">       A.EVENT,</span><br><span class="line">       A.WAIT_CLASS,</span><br><span class="line">       A.SECONDS_IN_WAIT,</span><br><span class="line">       b.LOCKED_MODE,</span><br><span class="line">       C.OWNER,</span><br><span class="line">       C.OBJECT_NAME,</span><br><span class="line">       C.OBJECT_TYPE</span><br><span class="line">  FROM V$SESSION A</span><br><span class="line"> INNER JOIN V$LOCKED_OBJECT B ON A.SID = b.SESSION_ID</span><br><span class="line"> INNER JOIN DBA_OBJECTS C ON B.OBJECT_ID = c.OBJECT_ID</span><br><span class="line"> WHERE A.WAIT_CLASS = &apos;Idle&apos;</span><br><span class="line">   AND A.SECONDS_IN_WAIT &gt; 10</span><br></pre></td></tr></table></figure>
<h2 id="查看锁主的记录rowid"><a href="#查看锁主的记录rowid" class="headerlink" title="查看锁主的记录rowid"></a>查看锁主的记录rowid</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br></pre></td><td class="code"><pre><span class="line">SELECT SID,</span><br><span class="line">       SERIAL#,</span><br><span class="line">       AUDSID,</span><br><span class="line">       PADDR,</span><br><span class="line">       USER#,</span><br><span class="line">       USERNAME,</span><br><span class="line">       EVENT,</span><br><span class="line">       WAIT_CLASS,</span><br><span class="line">       SECONDS_IN_WAIT,</span><br><span class="line">       ROW_WAIT_OBJ#,</span><br><span class="line">       ROW_WAIT_FILE#,</span><br><span class="line">       ROW_WAIT_BLOCK#,</span><br><span class="line">       ROW_WAIT_ROW#,</span><br><span class="line">       BLOCKING_SESSION_STATUS,</span><br><span class="line">       BLOCKING_INSTANCE,</span><br><span class="line">       BLOCKING_SESSION,</span><br><span class="line">       C.OWNER,</span><br><span class="line">       C.OBJECT_NAME,</span><br><span class="line">       C.OBJECT_TYPE,</span><br><span class="line">       dbms_rowid.rowid_create(1,</span><br><span class="line">                               ROW_WAIT_OBJ#,</span><br><span class="line">                               ROW_WAIT_FILE#,</span><br><span class="line">                               ROW_WAIT_BLOCK#,</span><br><span class="line">                               ROW_WAIT_ROW#)</span><br><span class="line">  FROM V$SESSION A</span><br><span class="line"> INNER JOIN V$LOCKED_OBJECT B ON A.SID = b.SESSION_ID</span><br><span class="line"> INNER JOIN DBA_OBJECTS C ON B.OBJECT_ID = c.OBJECT_ID</span><br><span class="line"> WHERE BLOCKING_SESSION IS NOT NULL;</span><br></pre></td></tr></table></figure>
<h2 id="oracle命令行导入SQL脚本"><a href="#oracle命令行导入SQL脚本" class="headerlink" title="oracle命令行导入SQL脚本"></a>oracle命令行导入SQL脚本</h2><p>使用@导入<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">SQL&gt;@/home/oracle/a.sql;</span><br></pre></td></tr></table></figure></p>

    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/oracle/" rel="tag"># oracle</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2019/03/20/Git汇总/" rel="prev" title="Git汇总">
      <i class="fa fa-chevron-left"></i> Git汇总
    </a></div>
      <div class="post-nav-item">
    <a href="/2019/04/07/数据库三范式/" rel="next" title="数据库三范式">
      数据库三范式 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          Table of Contents
        </li>
        <li class="sidebar-nav-overview">
          Overview
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#将a表的某些列插入b表的某些列"><span class="nav-number">1.</span> <span class="nav-text">将a表的某些列插入b表的某些列</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#重命名表"><span class="nav-number">2.</span> <span class="nav-text">重命名表</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#重命名字段"><span class="nav-number">3.</span> <span class="nav-text">重命名字段</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#修改字段类型"><span class="nav-number">4.</span> <span class="nav-text">修改字段类型</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#增加多个字段"><span class="nav-number">5.</span> <span class="nav-text">增加多个字段</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#主键操作"><span class="nav-number">6.</span> <span class="nav-text">主键操作</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#删除表"><span class="nav-number">7.</span> <span class="nav-text">删除表</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#查询表所属表空间"><span class="nav-number">8.</span> <span class="nav-text">查询表所属表空间</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#查询索引所在表空间"><span class="nav-number">9.</span> <span class="nav-text">查询索引所在表空间</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#查询表的建表DDL"><span class="nav-number">10.</span> <span class="nav-text">查询表的建表DDL</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#查看所有表空间大小以及使用情况"><span class="nav-number">11.</span> <span class="nav-text">查看所有表空间大小以及使用情况</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#指定表空间查询所有表名"><span class="nav-number">12.</span> <span class="nav-text">指定表空间查询所有表名</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#通过指定表空间查询所属表的占用空间"><span class="nav-number">13.</span> <span class="nav-text">通过指定表空间查询所属表的占用空间</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#删除列"><span class="nav-number">14.</span> <span class="nav-text">删除列</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#查询所有表及其所使用的表空间"><span class="nav-number">15.</span> <span class="nav-text">查询所有表及其所使用的表空间</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#查询所有表空间大小"><span class="nav-number">16.</span> <span class="nav-text">查询所有表空间大小</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#查询版本"><span class="nav-number">17.</span> <span class="nav-text">查询版本</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#查看长时间未commit会话，10秒未commit"><span class="nav-number">18.</span> <span class="nav-text">查看长时间未commit会话，10秒未commit</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#查看锁主的记录rowid"><span class="nav-number">19.</span> <span class="nav-text">查看锁主的记录rowid</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#oracle命令行导入SQL脚本"><span class="nav-number">20.</span> <span class="nav-text">oracle命令行导入SQL脚本</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">Fengorz</p>
  <div class="site-description" itemprop="description">A Quiet Departure.</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">125</span>
          <span class="site-state-item-name">posts</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">68</span>
        <span class="site-state-item-name">categories</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">87</span>
        <span class="site-state-item-name">tags</span></a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Fengorz</span>
</div>
  <div class="powered-by">Powered by <a href="https://hexo.io" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.org" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a>
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>
<script src="/js/utils.js"></script><script src="/js/motion.js"></script>
<script src="/js/schemes/pisces.js"></script>
<script src="/js/next-boot.js"></script>



  















  

  

</body>
</html>
